package com.chixing.day13.ArrayList;

import java.util.HashSet;

public class HashSetDemo {
    public static void main(String[] args){
        HashSet<String> set = new HashSet<>();
        set.add("one");
        set.add("two");
        set.add("three");
        System.out.println(set);

        HashSet<Student> setStudent =   new HashSet<>();
        setStudent.add(new Student(107,"jason"));
        setStudent.add(new Student(108,"mars"));

        //重写equals方法,
        //   hashcode方法
        setStudent.add(new Student(109,"lyon"));
        setStudent.add(new Student(109,"lyon"));
        System.out.println(setStudent);

    }
}
